package simple;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

/**
 * 单向发送
 */
public class OneWayProducer {
    public static void main(String[] args) throws Exception{
        DefaultMQProducer producer = new DefaultMQProducer("syncProducer");
        producer.setNamesrvAddr("192.168.1.153:9876");
        producer.start();
        Message message = new Message("simple", "tag1", "单向发送".getBytes(StandardCharsets.UTF_8));
        producer.sendOneway(message);

        producer.shutdown();

    }
}
